package com.project.util;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Random;

public class DateUtil {
    public static String getDateYYYY_MM_DD_NOW(){
        LocalDate date = LocalDate.now();
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        String formattedDate = date.format(formatter);
        return formattedDate;
    }
    public static String getDateYYYYMMDDHHSSmmNOW(){
        LocalDateTime date = LocalDateTime.now();
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
        String formattedDate = date.format(formatter);
        return formattedDate;
    }

    public static int RandomNum(int end){
        Random random = new Random();
        int randomNumber = random.nextInt(end) + 1;
        return randomNumber;
    }
    public static void main(String[] args) {
        String str=    DateUtil.getDateYYYYMMDDHHSSmmNOW();
        System.out.println(str);
    }
}